import { http } from "../http";
import { ListResponseType } from "../globalType";

const baseUrl = "/api/dms/ogaManage";

// 组织结构类型定义
export interface OgaType {
  id?: string;
  code: string;
  name: string;
}

// 添加组织结构参数类型
export interface AddOgaType {
  id?: string;
  code: string;
  name: string;
}

// 查询所有组织结构
export const getOgaListAPI = () => {
  return http.get(`${baseUrl}/list`);
};

// 根据编号查询组织结构
export const getOgaByCodeAPI = (code: string) => {
  return http.get(`${baseUrl}/get/${code}`);
};

// 添加组织结构
export const addOrUpdateAPI = (params: AddOgaType) => {
  return http.post(`${baseUrl}/addOrUpdate`, params);
};

// 删除组织结构
export const deleteOgaAPI = (code: string) => {
  return http.delete(`${baseUrl}/delete/${code}`);
};
